package com.example.zbh.dsliao.presenter;

import com.example.zbh.dsliao.model.LoginModel;
import com.example.zbh.dsliao.model.modelinterface.ModelLoginInterface;
import com.example.zbh.dsliao.presenter.presenterinterface.PresenterRegisterInterface;
import com.example.zbh.dsliao.ui.viewinterface.ViewRegisterInterface;

import java.util.Map;

/**
 * Created by dllo on 15/11/18.
 */
public class LoginPresenter extends BasePresenter<ViewRegisterInterface> implements PresenterRegisterInterface{
    private ViewRegisterInterface viewRegisterInterface;
    private ModelLoginInterface modelLoginInterface;


    public LoginPresenter(ViewRegisterInterface viewRegisterInterface) {
        this.viewRegisterInterface = viewRegisterInterface;
        modelLoginInterface = new LoginModel();
    }
    public void startLogin(Map<String, String> map){
        modelLoginInterface.checkLogInUser(map,this);

    }


    @Override
    public void checkResult(String s) {
        viewRegisterInterface.showResult(s);

    }

    @Override
    public void checkSucResult() {

    }

    @Override
    public void checkFailResult(String s) {
        viewRegisterInterface.showFailResult(s);

    }
}
